fn main() {
    // 创建新的vector
    let v: Vec<i32> = Vec::new();

    // 使用vec!宏创建
    let v1 = vec![1, 2, 3, 4, 5];

    let mut v2 = Vec::new();
    //更新vector, push
    v2.push(5);
    v2.push(6);
    v2.push(7);

    //读取:索引或者get
    let third: &i32 = &v1[2];
    println!("The third element is {third}");

    let third: Option<&i32> = v1.get(2);
    match third {
        Some(third) => println!("The third element is {third}"),
        None => println!("There is no third element"),
    }

    //遍历vector中元素,不可增加和删除元素
    for i in &v1 {
        println!("{i}");
    }
    for i in &mut v2 {
        *i += 50;
    }
    for i in &v2 {
        println!("{i}");
    }

    enum SpredsheetCell {
        Int(i32),
        Float(f64),
        Text(String),
    }

    let row = vec![
        SpredsheetCell::Int(3),
        SpredsheetCell::Text(String::from("blue")),
        SpredsheetCell::Float(10.12),
    ];
}
